function histplot(x,binedge,into); 
% Function plots the histogram of the matrix  x 
% by counting the elements of x contained in each bin 
% whose upper edge is determined by binegde 
% into.title allows to define a title string 
% into.scale =1 divides by the number of rows in x for plotting
[N,BIN]=histc(x,binedge);
if nargin > 2; 
    if into.scale==1; 
        rows=size(x,1);
        N=N/rows; 
    end; 
end
figure;
bar(binedge,N,'histc'); 
if nargin > 2; 
    title(into.title); 
end; 
